{# 登录 #}
<div class="es-box login-ajax-box"> 
      {% if app.user %}
        <div class="login-box-main">
            <img src="{{ file_path(app.user.mediumAvatar, 'avatar.png') }}">
            <h4>您好，{{ app.user.nickname }}</h4>
            <a href="{{ path('logout') }}">[安全退出]</a>
            <ul>
              {% if app.user.isTeacher() %}
                <li>
                  <a href="/my/teaching/courses">
                   <span class="iconfont icon-book"></span>
                    <p>课程</p>
                  </a>
                </li>

                <li>
                  <a href="/my/teacher/reviewing/test/list">
                    <span class="iconfont icon-text"></span>
                    <p>批阅</p>
                  </a>
                </li>
              {% else %}
                <li>
                  <a href="/my/courses/learning">
                   <span class="iconfont icon-book"></span>
                    <p>课程</p>
                  </a>
                </li>

                <li>
                  <a href="/my/quiz">
                    <span class="iconfont icon-text"></span>
                    <p>考试</p>
                  </a>
                </li>
              {% endif %}
                  <li><a href="/my/notebooks" >
                    <span class="iconfont icon-shu3"></span>
                    <p>笔记</p>
                  </a></li>

                  <li class="border-none">
                    <a href="/my/questions">
                     <span class="iconfont icon-wenda"></span>
                      <p>问答</p>
                    </a>
                  </li>
            </ul>
         </div> 
         {% else %}
          
        <div class="actions">
          <h2>账号登陆</h2>

          <form method="post" action="{{ path('login_check') }}"> 
            <p><input class="form-control" id="login_username" type="text" name="_username" value="" required /></p>
            <p> <input class="form-control" id="login_password" type="password" name="_password" required /></p>
            <button type="submit" class="btn" id="login-btn">登录</button>

            <label><input type="checkbox" name="_remember_me" checked="checked">    下次自动登录 </label>

            <span class="pull-right"><a href="{{ path('password_reset') }}">忘记密码 </a>&nbsp;|&nbsp;<a href="{{ path('register') }}" class="register">注册</a></span>
            <input type="hidden" name="_csrf_token" value="{{ csrf_token('site') }}">
          </form>

          {% set settings = setting('login_bind', []) %}

          {% if settings.enabled|default(false) %}
            <div class="logins">
                  合作账号登录

              {% if settings.renren_enabled|default(false) %}
                <a class="pull-right" href="{{ path('login_bind', {type:'renren', _target_path:targetPath|default('')}) }}" class="social-login-btn"><i class="social-icon social-icon-renren"></i></a>
              {% endif %}

             {% if settings.weibo_enabled|default(false) %}
                <a class="pull-right" href="{{ path('login_bind', {type:'weibo', _target_path:targetPath|default('')}) }}" class="social-login-btn"><i class="social-icon social-icon-weibo"></i></a>
              {% endif %}

              {% if settings.qq_enabled|default(false) %}
                <a class="pull-right" href="{{ path('login_bind', {type:'qq', _target_path:targetPath|default('')}) }}" class="social-login-btn"><i class="social-icon social-icon-qq"></i></a>
              {% endif %}

            </div>

          {% endif %}
        </div>
      {% endif %}
</div>